package com.tkmybatis.job;


import com.tkmybatis.service.ECTCNStudentService;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.core.SchedulerLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@Component
@Slf4j
public class DateJob {


    @Autowired
    private ECTCNStudentService ectcnStudentService;



    @Scheduled(cron = "0 0/5 * * * *")
    @SchedulerLock(name = "DateJob:executePrint", lockAtMostFor = 1000*60*4, lockAtLeastFor = 1000*60*4)
    public void executePrint(){
        DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = format.format(new Date());
        log.info("time="+time);
        //ectcnStudentService.
    }


}
